Skip to content

TSERV-861:Error exit code#29

Merged
lootic merged 9 commits intomasterfrom
TSERV-861-return-error-code
Feb 16, 2021
Merged

TSERV-861:Error exit code#29
lootic merged 9 commits intomasterfrom
TSERV-861-return-error-code

Conversation

@bsubba
Copy link
Copy Markdown
Contributor

@bsubba bsubba commented Feb 4, 2021

No description provided.

@bsubba bsubba requested review from akkikumar72 and lootic February 4, 2021 08:50
Comment thread bin/jobs_functions.js Outdated
@@ -77,7 +78,7 @@ module.exports = {
break;
default:
util.error("Unknown operatation");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could fix this spelling error while you're here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes. Sharp eye :)

Comment thread bin/license_functions.js Outdated
@@ -41,7 +42,7 @@ module.exports.dispatcher = function (args) {
break;
default:
util.error("Unknown operatation");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another "operatation" :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@andersjaensson
Copy link
Copy Markdown
Contributor

Didn't we want to use different error codes for different errors? I thought that was the idea when we added the gap between testjob errors and testengine errors. Perhaps it's not needed, I don't know.

@bsubba
Copy link
Copy Markdown
Contributor Author

bsubba commented Feb 4, 2021

Didn't we want to use different error codes for different errors? I thought that was the idea when we added the gap between testjob errors and testengine errors. Perhaps it's not needed, I don't know.

I think we decided to use only these codes to start with.

Comment thread bin/auditlog_functions.js Outdated
util.error("Unknown operatation");
break;
util.error("Unknown operation");
process.exit(100);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this error state is neither a testengine failure nor a testjob error. We kinda repurpose the 100-code a bit. I don't think it is super important, but I think someone else might. Could be worth asking about it. Especially since we say that "unknown operation" is a '1' later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is not related to testjob and testengine. May be it should not be exited with error code. Instead just give the message as before

Comment thread bin/license_functions.js Outdated
default:
util.error("Unknown operatation");
break;
util.error("Unknown operation");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thought here

Comment thread bin/jobs_functions.js Outdated
default:
util.error("Unknown operatation");
break;
util.error("Unknown operation");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a recurring pattern, maybe a function "exitWithStatusAndErrorMessage" would save a few lines in the code.

@lootic
Copy link
Copy Markdown
Contributor

lootic commented Feb 5, 2021

Didn't we want to use different error codes for different errors? I thought that was the idea when we added the gap between testjob errors and testengine errors. Perhaps it's not needed, I don't know.

I think we decided to use only these codes to start with.

I think we wanted to craete a division between testengine errors and tool errors.

Copy link
Copy Markdown

@akkikumar72 akkikumar72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…er to test status codes and see if something is broken. Updated all status codes to be '1' and added them to a few places to ensure everything works properly.
…the testScript and ensure that we return the correct status codes whenever we return print the usage.
Comment thread bin/user_functions.js Outdated
case 'import':
if (args.length < 2) {
util.error("Usage: testengine user import <file/url>");
util.printErrorAndExit("Usage: tes tengine user import <file/url>");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tes engine ?

Comment thread bin/user_functions.js Outdated
default:
util.error("Unknown operatation");
break;
util.printErrorAndExit("Unknown operation")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semicolon missing

Comment thread test/testScript.py Outdated
@@ -0,0 +1,121 @@
import os
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am guessing this test script will run all the combination of commands. But may be its good have some in the readme on how to run this command

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we want to document it a comment at the top of this file is better, I think it might be better to write it in JS as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to have it in Js

… describes how to run it. Fixing minor errors.
@lootic lootic force-pushed the TSERV-861-return-error-code branch from b39a5ed to 25f2abf Compare February 15, 2021 16:50
Comment thread test/testScript.js Outdated

function startSlowJobAndThenRunCli(command, flag) {
let testJobId = startJob('slow.xml')
runCli(command, flag, testJobId)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semicolon missing. There are other places as well where semicolon is missing. Please take a look

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@lootic lootic merged commit 62d4a7d into master Feb 16, 2021
@lootic lootic deleted the TSERV-861-return-error-code branch February 16, 2021 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants